package com.woniu01;
import java.util.Scanner;
import java.util.Calendar;

public class Test02 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入年份");
        int year = sc.nextInt();
        Calendar calendar = Calendar.getInstance();
        calendar.set(year, Calendar.FEBRUARY, 1);
        int lastDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
        System.out.println(year + "年的2月有" + lastDay + "天。");
    }
}
